#ifndef _CORE_FC_THREAD_H_
#define _CORE_FC_THREAD_H_

#include <rtthread.h>
#include <rtdevice.h>
#include <board.h>

//#include "attitude_algorithm.h"

#include "mpu6050.h"
#include "mpu9250.h"
#include "hmc5883l.h"

#include "pwm.h"

#include "flash.h"

#include "PID_controller.h"
#include "cf_9axis2.h" 

#define ARMED 1
#define DISARMED 0

extern unsigned char arm_status;

extern rt_timer_t timer_main;

extern struct rc_in rcin;
extern struct pwm_out pwmout;

extern struct mpu6050_rdata mpu6050rdata;
extern struct mpu6050_data mpu6050data;

extern struct mpu9250_rdata mpu9250rdata;
extern struct mpu9250_data mpu9250data;
extern struct mpu9250_cdata mpu9250cdata;

extern struct hmc5883l_rdata hmc5883lrdata;
extern struct hmc5883l_data hmc5883ldata;
extern struct hmc5883l_cdata hmc5883lcdata;

extern accel_m arg_accel_m;
extern gyro_m arg_gyro_m;
extern mag_m arg_mag_m;
extern euler arg_euler;

//extern struct sensor_data accel_data;
//extern struct sensor_data gyro_data;
//extern struct sensor_data mag_data;

//extern struct quaternion_data quat_data;
//extern struct attitude_data euler_data;

void start_up_thread_init(void);
void fly_sys_init(void);
void fly_sys_detach(void);
void fly_sys_restart(void);

#endif
